<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!DOCTYPE html>
<html>
<head>
    <title></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <script type="text/javascript" src="${pageContext.request.contextPath}/admin/scripts/jquery/jquery-1.7.1.js"></script>
</head>
<body>
    <form class="form-horizontal" role="form" action="${pageContext.request.contextPath}/AdminProductServlet?method=updateProduct"
          method="post" enctype="multipart/form-data">
        <div class="form-group">
            <label class="col-sm-2 control-label">商品图片</label>
            <div class="col-sm-4">
                <img src="${pageContext.request.contextPath}/${product.pimage}" width="50px" height="50px"/>

            </div>
            <label for="firstname1" class="col-sm-2 control-label">商品名称</label>
            <div class="col-sm-4">
                <input type="hidden" name="pid" value="${product.pid}">
                <input type="text" required name="pname" value="${product.pname}" class="form-control" id="firstname1" style="width:200px;" placeholder="">
            </div>
            <label for="firstname2" class="col-sm-2 control-label">是否热门</label>
            <div class="col-sm-4 col-lg-4">
                <select name="is_hot" class="form-control" id="firstname2"  style="width:200px;">
                    <c:if test="${product.is_hot == 1}">
                        <option value="1" selected="selected">是</option><option value="0">否</option>
                    </c:if>
                    <c:if test="${product.is_hot == 0}">
                        <option value="1" >是</option><option value="0" selected="selected">否</option>
                    </c:if>
                </select>
            </div>
            <label for="firstname3" class="col-sm-2 control-label">市场价格</label>
            <div class="col-sm-4 col-lg-4">
                <input type="text" required name="market_price" value="${product.market_price}" class="form-control" id="firstname3" style="width:200px;" placeholder="">
            </div>
            <label for="firstname4" class="col-sm-2 control-label">商城价格</label>
            <div class="col-sm-4 col-lg-4">
                <input type="text" required name="shop_price" value="${product.shop_price}" class="form-control" id="firstname4" style="width:200px;" placeholder="">
            </div>
            <label for="firstname5" class="col-sm-2 control-label">修改图片</label>
            <div class="col-sm-4 col-lg-4">
                <input type="file" name="pimage" class="form-control" id="firstname5" style="width:200px;"/>
            </div>
            <label for="firstname6" class="col-sm-2 control-label">商城类别</label>
            <div class="col-sm-4 col-lg-4">
                <select name="cid" class="form-control" id="firstname6" style="width:200px;">
                    <c:forEach items="${allCats}" var="c">
                        <option value="${c.cid}" <c:if test="${product.cid == c.cid}">selected="selected"</c:if> >${c.cname}</option>
                    </c:forEach>
                </select>
            </div>
            <label for="firstname8" class="col-sm-2 control-label">商品描述</label>
            <div class="col-sm-4 col-lg-4">
                <textarea name="pdesc" value="" class="form-control" id="firstname8" style="width:200px;" placeholder="">${product.pdesc}</textarea>
            </div>
            <label for="firstname9" class="col-sm-2 control-label">是否下架</label>
            <div class="col-sm-4 col-lg-4">
                <select name="pflag"  class="form-control" id="firstname9"  style="width:200px;">
                    <option value="0" <c:if test="${product.pflag == 0}">selected="selected"</c:if> >否</option>
                    <option value="1" <c:if test="${product.pflag == 1}">selected="selected"</c:if> >是</option>
                </select>
            </div>
        </div>

        <div class="form-group">
            <div class="col-sm-offset-2 col-sm-10">
                <button type="submit" class="btn btn-default">确认</button>
            </div>
        </div>
    </form>
</body>
</html>